define(function(require,exports){
	var $ = require("jquery"),
		util = require('util'),
		pubjs = require("pubjs"),
		view = require('@base/view');


	// 预算详情
	var BudgetTip = view.container.extend({
		init:function(config){
			config = pubjs.conf(config, {
				'vModel': {
					'total':'',
					'daily':''
				}
			});

			this.Super('init', arguments);
		},
		afterBuild:function(){
			var self = this;
			var el = self.getDOM();
			var c = self.getConfig();
			// 构建界面
			$([
				'<table class="table table-bordered">'+
					'<thead>'+
						'<tr>'+
							'<th class="w25pct tc">'+LANG('')+'</th>'+
							'<th class="w25pct tc">'+LANG('消耗（元）')+' </th>'+
							'<th class="w25pct tc">'+LANG('展示（千次）')+'</th>'+
							'<th class="w25pct tc">'+LANG('点击（次）')+' </th>'+
						'</tr>'+
					'</thead>'+
					'<tbody>'+
						'<tr>'+
							'<td class="w25pct tc">'+LANG('总预算')+'</td>'+
							'<td class="w25pct tc"> {{total.Budget==0?"不限":total.Budget}} </td>'+
							'<td class="w25pct tc"> {{total.Impression==0?"不限":total.Impression}}</td>'+
							'<td class="w25pct tc"> {{total.Click==0?"不限":total.Click}} </td>'+
						'</tr>'+
						'<tr>'+
							'<td class="w25pct tc">'+LANG('每日预算')+' </td>'+
							'<td class="w25pct tc"> {{daily.Budget==0?"不限":daily.Budget}}</td>'+
							'<td class="w25pct tc"> {{daily.Impression==0?"不限":daily.Impression}} </td>'+
							'<td class="w25pct tc"> {{daily.Click==0?"不限":daily.Click}} </td>'+

						'</tr>'+
					'</tbody>'+
				'</table>'
				].join('')).appendTo(el);

			this.vm.mount();
		},
		setData:function(data){
			this.vm.$.total = data.TotalLimit;
			this.vm.$.daily = data.DailyLimit;
		},
		reset: function(){
			this.vm.reset();
			return this;
		}
	});
	exports.info = BudgetTip;
});